﻿using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Drawing;

namespace pptGraphCreatorAddIn.Skins
{
    public class RedSkin: ISkin
    {
        public void Apply(PowerPoint.Shape sp)
        {
            FillShape(sp);
            SetShadow(sp);
            SetLineStyle(sp);
        }

        public void SetShadow(PowerPoint.Shape sp)
        {
            sp.Shadow.Style = Microsoft.Office.Core.MsoShadowStyle.msoShadowStyleOuterShadow;            
            sp.Shadow.Transparency = 0.65f;
            sp.Shadow.Size = 100;
            sp.Shadow.Blur = 3.15f;
            sp.Shadow.OffsetY = 1.8f;
        }

        public void FillShape(PowerPoint.Shape sp)
        {
            //Set the color
            sp.BackgroundStyle = Microsoft.Office.Core.MsoBackgroundStyleIndex.msoBackgroundStylePreset4;

            //Set Gradian orientation
            sp.Fill.OneColorGradient(Microsoft.Office.Core.MsoGradientStyle.msoGradientDiagonalUp, 2, 0.903f);
                        

            sp.Fill.GradientStops.Insert(Color.FromArgb(42, 45, 155).ToArgb(), 0, 0);
            sp.Fill.GradientStops.Insert(Color.FromArgb(58, 61, 203).ToArgb(), 0.8f, 0);
            sp.Fill.GradientStops.Insert(Color.FromArgb(55, 59, 206).ToArgb(), 1, 0);
            
            sp.Fill.RotateWithObject = Microsoft.Office.Core.MsoTriState.msoTrue;
        }

        public void SetLineStyle(PowerPoint.Shape sp)
        {
            sp.Line.Weight = 0.75f;
            sp.Line.ForeColor.RGB = Color.FromArgb(72, 75, 190).ToArgb();
        }
    }
}
